<!-- <page-header-wrapper [title]="''"></page-header-wrapper>
<nz-card>
  <div nz-row nzGutter="8">
    <div nz-col [nzSpan]="_$expand ? 24 : 18">
      <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
    </div>
    <div nz-col [nzSpan]="_$expand ? 24 : 6" [class.text-right]="_$expand">
      <button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="isLoading && st.loading" (click)="search()"
        acl [acl-ability]="['TAX-ORDERREPORT-search']">查询</button>
      <button nz-button (click)="resetSF()">重置</button>
      <button nz-button (click)="resetSF()" acl [acl-ability]="['TAX-ORDERREPORT-export']">导出</button>
      <button nz-button nzType="link" (click)="expandToggle()">
        {{ !_$expand ? '展开' : '收起' }}
        <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
      </button>
    </div>
  </div>
</nz-card> -->

<nz-card class="table-box">
  <div class="tab_header">
    <label class="page_title"> <label class="driver">|</label> 订单上报</label>
    <nz-tabset [nzTabBarExtraContent]="extraTemplate" *ngIf="tabs.length > 0">
      <nz-tab *ngFor="let tab of tabs" [nzTitle]="tab.name" (nzSelect)="selectChange(tab)"> </nz-tab>
    </nz-tabset>
  </div>

  <!-- 数据列表 -->
  <st
    #st
    [scroll]="{ x: '1200px', y: scrollY }"
    [data]="service.$api_getTaxOrderPage_page"
    [columns]="columns"
    [req]="{ params: reqParams }"
    [page]="{}"
    [loading]="service.http.loading"
  >
    <ng-template st-row="putStatus" let-item let-index="index">
      <!-- <a (click)="viewAuditResult(item)" *ngIf="item?.billStatus === '2'">{{item?.billStatusLabel}}</a> -->
      <span *ngIf="item?.putStatus == '0'">待上传</span>
      <span *ngIf="item?.putStatus == '1'">已上传</span>
      <span *ngIf="item?.putStatus == '3'">上传中</span>
      <span *ngIf="item?.putStatus == '2'" style="color: red" (click)="unnormal(item)">上传异常</span>
    </ng-template>
    <ng-template st-row="checkStatus" let-item let-index="index">
      <!-- <a (click)="viewAuditResult(item)" *ngIf="item?.billStatus === '2'">{{item?.billStatusLabel}}</a> -->
      <span *ngIf="item?.checkStatus == '0'">校验中</span>
      <span *ngIf="item?.checkStatus == '1'">通过</span>
      <!-- <span  *ngIf="item?.checkStatus == '2'" style="color: red;" (click)="unnormal(item)">不通过</span> -->
      <a *ngIf="item?.checkStatus == '2'" style="color: red" (click)="viewResult(item)">不通过</a>
    </ng-template>
    <ng-template st-row="driverName" let-item let-index="index">
      <div> {{ item?.driverName }}{{ item?.driverPhone ? '/' + item?.driverPhone : '' }} </div>
    </ng-template>
    <!-- <ng-template st-row="localValid" let-item let-index="index">
      <a (click)="viewResult(item)" *ngIf="item?.billStatus === '2'">{{item?.billStatusLabel}}</a>
      <span *ngIf="item?.billStatus !== '2'">{{item?.billStatusLabel}}</span>
    </ng-template> -->
    <ng-template st-row="loadingPicture" let-item let-index="index">
      <div class="imgBox">
        <div *ngIf="item.loadingPicture">
          <a (click)="viewPhoto([item.loadingPicture])" class="text-blue-dark" nzType="text" nz-button>查看</a>
          <!-- <app-imagelist style="width: 60px" [imgList]="[item.loadingPicture]"> </app-imagelist> -->
        </div>
      </div>
    </ng-template>
    <ng-template st-row="unloadPicture" let-item let-index="index">
      <div class="imgBox">
        <div *ngIf="item.unloadPicture">
          <a (click)="viewPhoto([item.unloadPicture])" class="text-blue-dark" nzType="text" nz-button>查看</a>
          <!-- <app-imagelist style="width: 40px" [imgList]="[item.unloadPicture]"> </app-imagelist> -->
        </div>
      </div>
    </ng-template>
    <ng-template st-row="loadingLadingBill" let-item let-index="index">
      <div class="imgBox">
        <div *ngIf="item.loadingLadingBill">
          <a (click)="viewPhoto([item.loadingLadingBill])" class="text-blue-dark" nzType="text" nz-button>查看</a>
          <!-- <app-imagelist style="width: 40px" [imgList]="[item.loadingLadingBill]"> </app-imagelist> -->
        </div>
      </div>
    </ng-template>
    <ng-template st-row="goodsName" let-item let-index="index">
      <div>{{ item.goodsName ? item.goodsName : '--' }} </div>
      <div> {{ item.loadWeight ? item.loadWeight : '--' }}吨/{{ item.loadVolume ?item.loadVolume: '--' }}方 </div>
    </ng-template>
    <ng-template st-row="signatureForm" let-item let-index="index">
      <div class="imgBox">
        <div *ngIf="item.signatureForm">
          <a (click)="viewPhoto([item.signatureForm])" class="text-blue-dark" nzType="text" nz-button>查看</a>
          <!-- <app-imagelist style="width: 40px" [imgList]="[item.signatureForm]"> </app-imagelist> -->
        </div>
      </div>
    </ng-template>
    <ng-template st-row="orderAmount" let-item let-index="index">
      <div class="text-right">{{ item?.orderAmount | currency }}</div>
    </ng-template>
    <ng-template st-row="wayAmount" let-item let-index="index">
      <div class="text-right">{{ item?.wayAmount | currency }}</div>
    </ng-template>
  </st>
</nz-card>
<ng-template #extraTemplate>
  <div class="d-flex align-items-center">
    <div class="mr-md">
      已选择
      <strong class="text-red">{{ selectedRows.length }}</strong> 条数据
    </div>
    <button nz-button nzDanger [nzLoading]="isLoading && st.loading" acl [acl-ability]="['TAX-ORDERREPORT-search']" (click)="openDrawer()"
      >筛选</button
    >
    <button nz-button nzDanger acl [acl-ability]="['TAX-ORDERREPORT-export']" (click)="exportList()"> 导出</button>
    <button nz-button nz-dropdown [nzDropdownMenu]="menu" nzPlacement="bottomLeft">
      更多<i nz-icon nzType="down" nzTheme="outline"></i
    ></button>
    <nz-dropdown-menu #menu="nzDropdownMenu">
      <ul nz-menu>
        <li nz-menu-item (click)="upload()" acl [acl-ability]="['TAX-ORDERREPORT-upload']"> 上传 </li>
        <li nz-menu-item (click)="recall()" acl [acl-ability]="['TAX-ORDERREPORT-recall']"> 撤回 </li>
        <li nz-menu-item (click)="resetData()" acl [acl-ability]="['TAX-ORDERREPORT-resetData']"> 更新数据 </li>
        <li nz-menu-item (click)="uploadSetting()" acl [acl-ability]="['TAX-ORDERREPORT-uploadSetting']"> 税务设置 </li>
      </ul>
    </nz-dropdown-menu>
  </div>
</ng-template>
